﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using System.Data;

namespace logic
{
    public class price
    {
        public static void insert(PriceEntity pr)
        {
            Price.insert(pr);
        }

        public static void updateByProduct(PriceEntity pr)
        {
            Price.updateByProduct(pr);
        }

        public static PriceEntity getByProduct(int productId,int companyId)
        {
            return Price.getByProduct(productId, companyId);
        }
        public static PriceEntity getByProduct(int productId, string businessnature)
        {
            return Price.getByProduct(productId, businessnature);
        }

        public static void updateByAdmin(PriceEntity pr)
        {
            Price.updateByAdmin(pr);
        }
     

        public static decimal getPriceByProductAndCompany(int productId, int companyId)
        {

            return Price.getPriceByProductAndCompany(productId, companyId); 
            
        }
        public static DataSet selectSupplyPriceList(string where, string orderby, int pagesize, int pageindex)
        {
            return DAL.DbHelper.ExecuteDataSetPageSize("*", "[dbo].[vw_Price_supplyPriceList]", where, "productId", orderby, pagesize, pageindex);
        }

        public static DataTable selectSupplyPriceListFilterCols(string cols,string where, string orderby)
        {
            return DAL.DbHelper.ExecuteDataTableDynamic(cols, "[dbo].[vw_Price_supplyPriceList]", where,orderby);
            
        }

        public static DataSet getSupplyPriceList()
        {
            return Price.getSupplyPriceList();
        }

        public static void changeSellerInfor(int psId,int adminid)
        {
            Price.changeSellerInfor(psId,adminid);
        }
        public static DataTable listByWhere(string where)
        {
            return Price.listByWhere(where);
        }

        public static DataTable listWithBusinessNatures(int productId, int companyId)
        {
            return Price.listWithBusinessNatures(productId, companyId);
        }

        public static DataTable listWithAllParentCategory()
        {
            return Price.listWithAllParentCategory();
        }
    }
}
